<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored ="false"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>北京市电子行政监察平台-新建文档</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="<%=path%>/css/base.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/frame.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jQueryTree-1.2.1.css" rel="stylesheet" type="text/css" />
		<%@ include file="./document_getOnlineInfoFromSession.jsp"%>
		<script type="text/javascript">
			var path = "<%=path%>";
		</script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-1.4.3.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.metadata.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.validate.fixed.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/commons/dateUtilConvert.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/config/client-config.js"></script>
		<script type="text/javascript">
			//载入配置
			loadConfigQueue(["doc-config.js"]);
		</script>
		
	    <script type="text/javascript" src="<%=path%>/javascript/system/util.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/oacore.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/jQueryTree-1.2.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/AccountBook2.js"></script>
		 <script language="javascript" type="text/javascript" src="<%=path%>/javascript/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/init.js"></script>
		<script type="text/javascript"
			src="<%=path%>/javascript/webOffice/commons.js">
		</script>
		<script type="text/javascript">
			var autoSave = true;
			var accountBookJsonStr = "<%=((String)request.getAttribute("approvalUserList"))%>";
			var curAction = "<%=path%>/web/saveOrUpdateTranDocAction.action";
			
			$(function () {
				//初始化去向选择器
				var selector = $("input.nextstep-option").bind("click", function () {
					var $this = $(this);
					if($this.hasClass("nextstep-option-submit"))
					{
						$("#note").addClass("ignore");
						$("#nextPerson").removeClass("ignore");
						$("tr.nextstep-sure").hide();
						$("tr.nextstep-submit").show();
					}
					else if($this.hasClass("nextstep-option-sure"))
					{
						$("#nextPerson").addClass("ignore");
						$("#note").removeClass("ignore");
						$("tr.nextstep-submit").hide();
						$("tr.nextstep-sure").show();
					}
				});

				//触发选择
				selector.filter(":checked").trigger("click");
				
				//初始化时间选择器
				$(".use-datepicker").focus(function () {
			        WdatePicker({
			                dateFmt: "yyyy-MM-dd",
			                minDate: "%y-%M-{%d}"
			            });
            	});
            	new AccountBook({
					input: $("#nextPerson"),
					data: $.parseJSON(accountBookJsonStr),
					pretreatment: function (data) {
						data.id = data.userInfoId;
						delete data.userInfoId;
						data.content = data.userName;
						delete data.userName;
						return data;
					}
                });
            });
		</script>
		<style type="text/css">
			div {
				position: static;
			}
		</style>
	</head>
	 <body onunload="UnLoad();" >
		<div id="mainPage" class="surround-layout">
           <jsp:include page="../../../frame/top.jsp" flush="true"></jsp:include>
			<div class="middle">
				 <jsp:include page="../../../frame/middle_left.jsp" flush="true">
					<jsp:param value="1009-1010" name="view"/>
				  </jsp:include>
				<!-- 右侧内容输出 -->
				<div class="right">
					<div class="right-all-content">
						<div>
							<div class="content-line-wrap">
								<div class="content-line-left content-line">
									<h1 class="content-title">
										<span>
											<a href="<%=path %>/web/toUserAccountListAction.action">文档起草</a>
										</span>
										<span>
											&gt;&gt;
										</span>
										<span>
											<a href="<%=path %>/web/toCreatePageAction.action">新建文档</a>
										</span>
									</h1>
								</div>
							</div>
							<div class="inner-dialog">
							 <form method="post" name="webform"  id="saveDocumentForm" onsubmit="SaveDocument();" class="normal-form use-def-validate">
								<h1 class="inner-dialog-title">
									<span style="float: left;">新建文档</span>
									<span style="float: left;margin-top: -4px;margin-left: 16px;">
										<input type="submit" value="保存" class="special green-button-sa" style="width: 48px;" onclick="$('.save-unvalidate').addClass('ignore');$('#saveDocumentForm').data('stopAutoSave', true).attr('action', '<%=path%>/web/saveOrUpdateTranDocAction.action?fromFlag=business');$('.needvalid').addClass('ignore');"></input>
									</span>
								</h1>
								<div class="inner-dialog-content">
										 <input id="path" type="hidden" name="transientDocumentDTO.path" value="${transientDocumentDTO.path}"> 
	                                     <input type="hidden" name="jobId" value="${jobId}">
	                                     <input type="hidden" name="fileType" value="${fileType}">
	                                     <input type="hidden" name="transientDocumentDTO.transientDocId" value="${transientDocumentDTO.transientDocId}" id="tDocId" >
	                                     <input type="hidden" name="transientDocumentDTO.docMarkTime" value="${transientDocumentDTO.docMarkTime}" id="docMarkTime" >
	                                     <input id="documentVersion" type="hidden"  name="transientDocumentDTO.documentVersion"  value="${transientDocumentDTO.documentVersion}"/>
										<h1 class="inner-form-title">文档任务信息</h1>
										<table class="data-view-table tiny-form-table" cellspacing="0">
											<tbody>
												<tr class="odd">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														文档任务名称:
													</td>
													<td colspan="3" class="dvt-value">

														<input type="text" class="save-unvalidate shadow tft-textinput {required: true, dataName: true, maxlength: 32, messages: {required: '文档任务名称项为必填', maxlength: '文档任务名称项的长度不能超过32个字符', dataName: '任务名称的格式须为中英文、数字及下划线'}}" name="transientDocumentDTO.missionName" value="${transientDocumentDTO.missionName}"/>
													</td>
												</tr>
												<tr class="even two-field">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														来源:
													</td>
													<td class="dvt-value">
                                                      <select id="sel_ImportantLevel" name="transientDocumentDTO.importantLevelNum" class="save-unvalidate tft-select {required: true, messages: {required: '来源项为必选'}}">
                                                        <s:if test="dataValueList">
                                                          <s:iterator id="dataValue" value="dataValueList">
                                                            <option value="${dataValue.dataValueId}">${dataValue.value}</option>
                                                          </s:iterator>
                                                        </s:if>
                                                      </select>
													</td>
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														任务计划结束日期:
													</td>
													<td class="dvt-value">
														<input type="text" class="save-unvalidate use-def-datepicker shadow tft-textinput {required: true, messages: {required: '任务计划结束日期项为必选'}}" name="transientDocumentDTO.missionEnd" value="<s:date name='transientDocumentDTO.missionEnd' format= 'yyyy-MM-dd'/>"/>
														
													</td>
												</tr>
												<tr class="odd">
													<td class="dvt-filed">
														任务描述:
													</td>
													<td colspan="3" class="dvt-value">
														<textarea class="save-unvalidate shadow tft-textarea {maxlength: 64, messages: {maxlength: '任务描述项的长度不能超过64个字符'}}" name="transientDocumentDTO.missionDescript">${transientDocumentDTO.missionDescript}</textarea>
													</td>
												</tr>
											</tbody>
										</table>
										<h1 class="inner-form-title">文档信息</h1>
										<table class="data-view-table tiny-form-table" cellspacing="0">
											<tbody>
												<tr class="odd">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														文档名称:
													</td>
													<td class="dvt-value">
														<input type="text" class="shadow tft-textinput {required: true, dataName: true, maxlength: 32, messages: {required: '文档任务名称项为必填', maxlength: '文档名称项的长度不能超过32个字符', dataName: '文档名称的格式须为中英文、数字及下划线'}}" name="transientDocumentDTO.docName" value="${transientDocumentDTO.docName}"/>
													</td>
												</tr>
											</tbody>
										</table>
		                              <div class="online-editor" style="height: 520px;">
	                                      <script src="<%=path%>/javascript/webOffice/iWebOffice2009.js"></script>
	                                    </div>
										<table class="data-view-table tiny-form-table" cellspacing="0">
											<tbody>
												<tr class="odd">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														下一步去向:
													</td>
													<td class="dvt-value">
														<label class="tft-radiolabel odd">
															<input type="radio"  value="审批" class="nextstep-option nextstep-option-submit" name="transientDocumentDTO.processStr" checked="checked"/> 提交审批定稿（交给领导审批）
														</label>
														<label class="tft-radiolabel even">
															<input type="radio"  class="nextstep-option nextstep-option-sure" value="定稿" name="transientDocumentDTO.processStr"/> 提交审批定稿（交给领导审批）
														</label>
													</td>
												</tr>
												<tr class="even nextstep-submit" style="display: none;">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														选择批示人:
													</td>
													<td class="dvt-value">
													    <input type="text" id="nextPerson" name="transientDocumentDTO.approvalPersonNum" class="save-unvalidate shadow tft-textinput use-accountbook {required: true, messages: {required: '下一个批示人为必选'}}" />
													</td>
												</tr>
												<tr class="even nextstep-sure" style="display: none;">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														备注:
													</td>
													<td class="dvt-value">
														<textarea id="note" class="save-unvalidate shadow tft-textarea {required: true, maxlength: 64, messages: {required: '定稿时必填备注', maxlength: '备注项的长度不能超过64个字符'}}" name="transientDocumentDTO.descipt">${transientDocumentDTO.descipt}</textarea>
													</td>
												</tr>
											</tbody>
										</table>
										<table>
											<tr>
												<td>
													<input type="submit" value="确定" class="special originate" onclick="$('#saveDocumentForm').data('stopAutoSave', true);curAction = '<%=path%>/web/submitTranDocAction.action';$('.needvalid').removeClass('ignore');"></input>
												</td>
											</tr>
										</table>
									
								</div>
								</form>
							</div>
						</div>
					</div>
				</div>
				<!--  -->
			</div>
		</div>
	</body>
</html>